package cn.taketoday.live;

import com.fasterxml.jackson.annotation.JsonIgnore;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * @author TODAY
 * @date 2020/9/10 11:36
 */
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class ErrorMessage implements Result {

  private String message;

  public static ErrorMessage failed(String message) {
    return new ErrorMessage(message);
  }

  public static ErrorMessage failed() {
    return new ErrorMessage("未知错误");
  }

  @Override
  @JsonIgnore
  public Object getData() {
    return message;
  }
}
